Fix (well, paper over...) heap-use-after-free in psitrex.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 31 Dec 2013 06:57:15 +0000 (06:57 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 31 Dec 2013 06:57:15 +0000 (06:57 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4673 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/psitrex.cc

index f514428cfd3704b36de184271283449425a79b46..f7beaa43436da5cd70f1f53f4eb6f97f2ccb9849 100644 (file)
@@ -357,9 +357,11 @@ psit_waypoint_w(gbfile* psit_file, const waypoint* wpt)
 
   ident = global_opts.synthesize_shortnames ?
           mkshort(mkshort_handle, src) :
-          CSTRc(wpt->shortname);
+          xstrdup(CSTRc(wpt->shortname));
 
   gbfprintf(psit_file, " %-6s, ", ident);
+  xfree(ident);
+
   icon = gt_find_icon_number_from_desc(wpt->icon_descr, PCX);
 
   if (get_cache_icon(wpt) && wpt->icon_descr.compare("Geocache Found") != 0) {